﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<JLL.China.Web.Areas.Portal.Models.BannerModel>" %>
<%@ Import Namespace="System.IO" %>
<% using (Html.BeginForm("Index", "GlobalBanner", FormMethod.Post, new { id = "formID", enctype = "multipart/form-data", @class = "validateform" }))
   { %>
<%=Html.HiddenFor(x => x.Banner.Banner_ID) %>
<table class="banner_item" width="100%">
    <tbody>
        <tr>
            <td class="style1">
                <label>
                    Description (English):</label>
                <input id="content_validate" class="validate[required]" style="visibility: hidden;
                    height: 0; width: 0" />
                <%= Html.TextAreaFor(m => m.Banner.Content, new { id = "contentID", name = "contentID", @class = "ckeditors", cols = "5", rows = "5", style = "width: 100%" })%>
            </td>
            <td>
                &nbsp;
            </td>
            <td>
                <label>
                    Description (Local):</label>
                <input id="content_local_validate" class="validate[required]" style="visibility: hidden;
                    height: 0; width: 0" />
                <%= Html.TextAreaFor(m => m.Banner_Local.Content, new { id = "content_local", name = "content_local", @class = "ckeditors", cols = "5", rows = "5", style = "width: 100%" })%>
            </td>
        </tr>
        <tr>
            <td align="center" colspan="6" style="float:right;height: 50px" >
                <div style="position: absolute;float: inherit;margin-left: 40%  ">
                     <input type="submit" value="Submit" onclick="checkForm()" class="buttons" style="margin-right: 8px;
                    float: right" />
               
                </div>
               </td>
        </tr>
        <tr>
            <td class="style1">
            </td>
            <td>
                &nbsp;
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td colspan="3">
                <table border="0" cellpadding="0" cellspacing="0" id="id-form" class="upload-image-table">
                    <tr>
                        <th valign="top" style="padding-right: 30px; width: 188px">
                            <b>Upload Global Banner Images:</b>
                        </th>
                        <td>
                            <div style="text-align: left;">
                                <!--label for="Filedata">Upload photo(s)</label-->
                                <input type="file" name="file_upload" value="" id="file_upload" style="display: none" />
                                <a class="upload-img-btn hide " href="javascript:$('#file_upload').uploadify('upload','*');"
                                    style="float: left; margin-left: 278px;">Upload File(s)</a>
<%--                                    <input id="file_upload" name="file_upload" type="file" />--%>
<%--                                    <input id="uploadLink" onclick="$('#file_upload').uploadifyUpload();" type="button" value="Upload now" />--%>
                            </div>
                        </td>
                        <td valign="top">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <div class="form_divider">
                            </div>
                        </td>
                        <!--------------------------------------------------------------------->
                    </tr>
                    <tr>
                        <td colspan="3">
                            <div class="image_area" id="mediaphoto_content">
                                <b>Global banner images</b>
                                <div class="list">
                                    <% 
                                        var files = ViewData["files"] as List<FileInfo>;
                                        if (files != null)
                                        {%>
                                    <ul id="list1">
                                        <%
                                            string ImagePath = Url.Content("~/") + "Media/Banner/Global/";

                                            foreach (var item in files)
                                            {
                                        %>
                                        <li>
                                            <div>
                                                <img class="img_photo" src="<%=ImagePath + item.Name.ToString()%>" alt="img_photo"/>
                                            </div>
                                            <div class="tools">
                                                <div class="t-left">
                                                    &nbsp;</div>
                                                <div class="t-center">
<%--                                                    <a class="removelink info-tooltip" href="<%=Url.Content("~/")+ViewData["now_controller"]%>DeleteFile/<%=item.FullName%>"--%>
                                                        <a href="<%=Url.Action("DeleteFile",new {filename=item.FullName}) %>" class="removelink info-tooltip" title="Delete this image">
                                                        
                                                        <img src="<%=Url.Content("~/Content/")%>images/icon_delete.png" /></a> <a class="fancybox-button info-tooltip"
                                                            rel="fancybox-button" href="<%=ImagePath + item.Name.ToString()%>" title="Zoom this image">
                                                            <img src="<%=Url.Content("~/Content/")%>images/icon-zoom.png" /></a>
                                                </div>
                                                <div class="t-right">
                                                    &nbsp;</div>
                                            </div>
                                        </li>
                                        <%}     
                                        %>
                                    </ul>
                                    <%}
                        else
                        { %>
                                    <br />
                                    <br />
                                    <h4 style='color: #92B22C;'>
                                        No images at the moment</h4>
                                    <%} %>
                                    <br style="clear: both;" />
                                </div>
                                <!--#list-->
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        
    </tbody>
</table>
<%} %><!-- end id-form  -->